<template>
  <div class="list">
    <ul>
      <li>
        <input type="checkbox" name="" value="" v-model="item.status" />
        <img src="../../public/img/1.png.crdownload" alt="" />
        <p class="p">
          <span>{{ item.title }}</span>
          <span>星空、选服务</span>
          <span>
            <span>7天价保</span>
            <span>分期免息24期</span>
          </span>
          <span class="js">
            <b>￥{{ item.price }}</b>
            <span class="span">
              <span @click="jian">-</span>
              <span>{{ item.num }}</span>
              <span @click="jia(item.id)">+</span>
            </span>
          </span>
        </p>
      </li>
    </ul>
  </div>
</template>

<script setup>
import "./Shop.css";
import { defineProps } from "vue";
let ShopProps = defineProps({
  item: Object,
});

let { item } = ShopProps;
console.log(ShopProps, "111");
function jia(index) {
  console.log(index);
  item.num++;
}
function jian() {
  item.num--;
  if (item.num <= 1) {
    item.num = 1;
  }
}
</script>

<style lang="scss" scoped></style>
